home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / progs / DIRECTOR / data.z / Scriptable Authoring.dir / Scripts_16_Score Generation.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  4.5 KB  |  108 lines

  1. global gFloatName, gParadePartsList, gMaskName, gCostumeName
  2.  
  3. on CreateFloatAnimation
  4.   if gFloatName = #aquaFloat then
  5.     set currentFloat to the number of member "Aqua Float Loop"
  6.   else
  7.     if gFloatName = #cosmosFloat then
  8.       set currentFloat to the number of member "Cosmos Float Loop"
  9.     else
  10.       if gFloatName = #tropicanaFloat then
  11.         set currentFloat to the number of member "Tropical Float Loop"
  12.       end if
  13.     end if
  14.   end if
  15.   set returnFrame to the frame
  16.   CreateScoreRange(the floatChannel of gParadePartsList, 0, point(447, 129), point(-228, 129), currentFloat, label("Float start"), label("Float end"), 1)
  17.   go(returnFrame)
  18. end
  19.  
  20. on DeleteFloatFromScore
  21.   set returnFrame to the frame
  22.   DeleteScoreRange([the floatChannel of gParadePartsList], label("Float start"), label("Float end"), 1)
  23.   go(returnFrame)
  24. end
  25.  
  26. on CreateCaptainAnimation
  27.   set returnFrame to the frame
  28.   set headMember to member "Costume Mannequin" of castLib "Internal"
  29.   CreateScoreRange(the headChannel of gParadePartsList, 8, point(103, 245), point(103, 89), headMember, label("Captain start"), label("Captain waving"), 1)
  30.   CreateScoreRange(the headChannel of gParadePartsList, 8, point(103, 89), point(103, 89), headMember, label("Captain waving"), label("Captain leaving"), 1)
  31.   CreateScoreRange(the headChannel of gParadePartsList, 8, point(103, 89), point(103, 245), headMember, label("Captain leaving") + 1, label("Captain end"), 1)
  32.   set currentMask to the number of member gMaskName
  33.   if currentMask > 0 then
  34.     CreateScoreRange(the maskChannel of gParadePartsList, 36, point(103, 245), point(103, 89), currentMask, label("Captain start"), label("Captain waving"), 1)
  35.     CreateScoreRange(the maskChannel of gParadePartsList, 36, point(103, 89), point(103, 89), currentMask, label("Captain waving"), label("Captain leaving"), 1)
  36.     CreateScoreRange(the maskChannel of gParadePartsList, 36, point(103, 89), point(103, 245), currentMask, label("Captain leaving") + 1, label("Captain end"), 1)
  37.   end if
  38.   set costumeLongName to gCostumeName
  39.   delete char the number of chars in costumeLongName - 3 to the number of chars in costumeLongName of costumeLongName
  40.   set costumeLongName to costumeLongName && "Loop"
  41.   set currentCostume to the number of member costumeLongName
  42.   if currentCostume > 0 then
  43.     CreateScoreRange(the costumeChannel of gParadePartsList, 0, point(103, 290), point(103, 134), currentCostume, label("Captain start"), label("Captain waving"), 1)
  44.     CreateScoreRange(the costumeChannel of gParadePartsList, 0, point(103, 134), point(103, 134), currentCostume, label("Captain waving"), label("Captain leaving"), 1)
  45.     CreateScoreRange(the costumeChannel of gParadePartsList, 0, point(103, 134), point(103, 290), currentCostume, label("Captain leaving") + 1, label("Captain end"), 1)
  46.   end if
  47.   go(returnFrame)
  48. end
  49.  
  50. on DeleteCaptainFromScore
  51.   set returnFrame to the frame
  52.   DeleteScoreRange([the headChannel of gParadePartsList, the costumeChannel of gParadePartsList, the maskChannel of gParadePartsList], label("Captain start"), label("Captain end"), 1)
  53.   go(returnFrame)
  54. end
  55.  
  56. on CreateScoreRange spriteChannel, spriteInkNum, beginPoint, endPoint, memberNumber, startframe, endframe, updateFlag
  57.   beginRecording()
  58.   if updateFlag = 1 then
  59.     set the updateLock to 1
  60.   end if
  61.   set theType to the type of member memberNumber
  62.   case theType of
  63.     #bitmap:
  64.       set theType to 1
  65.     #filmLoop:
  66.       set theType to 16
  67.   end case
  68.   set totalFrames to endframe - startframe + 1
  69.   if beginPoint = endPoint then
  70.     set positionOffset to point(0, 0)
  71.   else
  72.     set pointOffset to endPoint - beginPoint
  73.     set positionOffset to pointOffset / totalFrames
  74.   end if
  75.   go(startframe)
  76.   repeat with currentFrame = startframe to endframe
  77.     set the type of sprite spriteChannel to theType
  78.     set the memberNum of sprite spriteChannel to memberNumber
  79.     set beginPoint to beginPoint + positionOffset
  80.     set the loc of sprite spriteChannel to beginPoint
  81.     set the ink of sprite spriteChannel to spriteInkNum
  82.     updateFrame()
  83.   end repeat
  84.   if updateFlag = 1 then
  85.     set the updateLock to 0
  86.   end if
  87.   endRecording()
  88. end
  89.  
  90. on DeleteScoreRange spriteList, startframe, endframe, updateFlag
  91.   beginRecording()
  92.   if updateFlag = 1 then
  93.     set the updateLock to 1
  94.   end if
  95.   go(startframe)
  96.   repeat with currentFrame = startframe to endframe
  97.     repeat with currentChannel in spriteList
  98.       set the type of sprite currentChannel to 0
  99.       set the scriptNum of sprite currentChannel to 0
  100.     end repeat
  101.     updateFrame()
  102.   end repeat
  103.   if updateFlag = 1 then
  104.     set the updateLock to 0
  105.   end if
  106.   endRecording()
  107. end
  108.